using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class creature_model_info : MangosBase
	{
		public System.UInt32? modelid;
		public System.Single? bounding_radius;
		public System.Single? combat_reach;
		public System.Byte? gender;
		public System.UInt32? modelid_other_gender;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `creature_model_info` (`modelid`, `bounding_radius`, `combat_reach`, `gender`, `modelid_other_gender`) VALUES ('{0}', '{1}', '{2}', '{3}', '{4}');", modelid.GetValueOrDefault(), bounding_radius.GetValueOrDefault(), combat_reach.GetValueOrDefault(), gender.GetValueOrDefault(), modelid_other_gender.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `creature_model_info` SET ");
			if(bounding_radius != null)
			{
				sb.AppendLine("`bounding_radius`='" + bounding_radius.Value.ToString() + "'");
			}
			if(combat_reach != null)
			{
				sb.AppendLine("`combat_reach`='" + combat_reach.Value.ToString() + "'");
			}
			if(gender != null)
			{
				sb.AppendLine("`gender`='" + gender.Value.ToString() + "'");
			}
			if(modelid_other_gender != null)
			{
				sb.AppendLine("`modelid_other_gender`='" + modelid_other_gender.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
				sb.Append(" WHERE `modelid`='" + modelid.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
